package cn.jw.starter.common;

import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableScheduling;

import cn.jw.starter.common.scheduletask.JwScheduledTaskService;
import cn.jw.starter.common.scheduletask.ScheduledTaskCore;
import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;

/**
 * common项目的自动化装配类
 * 
 * @author 王广帅
 * @version 1.0.0
 * @since 2024/8/15 21:42
 */
@Slf4j
@AutoConfiguration
@EnableScheduling
@Import(JwCommonConfig.class)
public class JwCommonAutoConfiguration {

    @PostConstruct
    public void init() {
        log.info("初始化common");
    }

    @Bean
    public ScheduledTaskCore scheduledTaskCore() {
        return new ScheduledTaskCore();
    }

    @Bean
    public JwScheduledTaskService jwScheduledTaskService() {
        return new JwScheduledTaskService();
    }
}
